/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import Classes.FracaoTempo;
import java.util.ArrayList;

/**
 *
 * @author Bruno
 */
public class CadastroValores extends javax.swing.JDialog {

    /**
     * Creates new form CadastroValores
     */
    public CadastroValores() {
        initComponents();
        setModal(true);
        numeroCondicoes(Integer.parseInt(spNumCond.getValue().toString()));
    }

    public void someO02() {
        jTempo02.setVisible(false);
        jLabel7.setVisible(false);
        jPreco02.setVisible(false);
        jTM02.setVisible(false);
    }

    public void someO03() {
        jTempo03.setVisible(false);
        jLabel8.setVisible(false);
        jPreco03.setVisible(false);
        jTM03.setVisible(false);
    }

    public void someO04() {
        jTempo04.setVisible(false);
        jLabel9.setVisible(false);
        jPreco04.setVisible(false);
        jTM04.setVisible(false);
    }

    public void someO05() {
        jTempo05.setVisible(false);
        jLabel10.setVisible(false);
        jPreco05.setVisible(false);
        jTM05.setVisible(false);
    }

    public void someO06() {
        jTempo06.setVisible(false);
        jLabel11.setVisible(false);
        jPreco06.setVisible(false);
        jTM06.setVisible(false);
    }

    public void someO07() {
        jTempo07.setVisible(false);
        jLabel12.setVisible(false);
        jPreco07.setVisible(false);
        jTM07.setVisible(false);
    }

    public void someO08() {
        jTempo08.setVisible(false);
        jLabel13.setVisible(false);
        jPreco08.setVisible(false);
        jTM08.setVisible(false);
    }

    public void apareceO02() {
        jTempo02.setVisible(true);
        jLabel7.setVisible(true);
        jPreco02.setVisible(true);
        jTM02.setVisible(true);
    }

    public void apareceO03() {
        jTempo03.setVisible(true);
        jLabel8.setVisible(true);
        jPreco03.setVisible(true);
        jTM03.setVisible(true);
    }

    public void apareceO04() {
        jTempo04.setVisible(true);
        jLabel9.setVisible(true);
        jPreco04.setVisible(true);
        jTM04.setVisible(true);
    }

    public void apareceO05() {
        jTempo05.setVisible(true);
        jLabel10.setVisible(true);
        jPreco05.setVisible(true);
        jTM05.setVisible(true);
    }

    public void apareceO06() {
        jTempo06.setVisible(true);
        jLabel11.setVisible(true);
        jPreco06.setVisible(true);
        jTM06.setVisible(true);
    }

    public void apareceO07() {
        jTempo07.setVisible(true);
        jLabel12.setVisible(true);
        jPreco07.setVisible(true);
        jTM07.setVisible(true);
    }

    public void apareceO08() {
        jTempo08.setVisible(true);
        jLabel13.setVisible(true);
        jPreco08.setVisible(true);
        jTM08.setVisible(true);
    }



    public void numeroCondicoes(int num) {
        switch (num) {
            case 1:
                someO02();
                someO03();
                someO04();
                someO05();
                someO06();
                someO07();
                someO08();
                break;
            case 2:
                apareceO02();
                someO03();
                someO04();
                someO05();
                someO06();
                someO07();
                someO08();
                break;
            case 3:
                apareceO02();
                apareceO03();
                someO04();
                someO05();
                someO06();
                someO07();
                someO08();
                break;
            case 4:
                apareceO02();
                apareceO03();
                apareceO04();
                someO05();
                someO06();
                someO07();
                someO08();
                break;
            case 5:
                apareceO02();
                apareceO03();
                apareceO04();
                apareceO05();
                someO06();
                someO07();
                someO08();
                break;
            case 6:
                apareceO02();
                apareceO03();
                apareceO04();
                apareceO05();
                apareceO06();
                someO07();
                someO08();
                break;
            case 7:
                apareceO02();
                apareceO03();
                apareceO04();
                apareceO05();
                apareceO06();
                apareceO07();
                someO08();
                break;
            case 8:
                apareceO02();
                apareceO03();
                apareceO04();
                apareceO05();
                apareceO06();
                apareceO07();
                apareceO08();
                break;
            default:
                someO02();
                someO03();
                someO04();
                someO05();
                someO06();
                someO07();
                someO08();
                break;
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        textoTituloJanela = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        spNumCond = new javax.swing.JSpinner();
        jLabel1 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jTempo01 = new javax.swing.JSpinner();
        jLabel2 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jTM01 = new javax.swing.JCheckBox();
        jLabel5 = new javax.swing.JLabel();
        jPreco01 = new javax.swing.JFormattedTextField();
        jTempo02 = new javax.swing.JSpinner();
        jPreco02 = new javax.swing.JFormattedTextField();
        jTM02 = new javax.swing.JCheckBox();
        jTempo03 = new javax.swing.JSpinner();
        jPreco03 = new javax.swing.JFormattedTextField();
        jTM03 = new javax.swing.JCheckBox();
        jTempo04 = new javax.swing.JSpinner();
        jPreco04 = new javax.swing.JFormattedTextField();
        jTM04 = new javax.swing.JCheckBox();
        jPreco08 = new javax.swing.JFormattedTextField();
        jTM08 = new javax.swing.JCheckBox();
        jTempo05 = new javax.swing.JSpinner();
        jTM05 = new javax.swing.JCheckBox();
        jPreco05 = new javax.swing.JFormattedTextField();
        jTempo06 = new javax.swing.JSpinner();
        jPreco06 = new javax.swing.JFormattedTextField();
        jTM06 = new javax.swing.JCheckBox();
        jTempo07 = new javax.swing.JSpinner();
        jPreco07 = new javax.swing.JFormattedTextField();
        jTM07 = new javax.swing.JCheckBox();
        jTempo08 = new javax.swing.JSpinner();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Preços para Horistas - PowerPark");
        setResizable(false);

        textoTituloJanela.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
        textoTituloJanela.setText("Preços para Horistas");

        jButton1.setText("Cancelar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Salvar");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        spNumCond.setModel(new javax.swing.SpinnerNumberModel(1, 1, 8, 1));
        spNumCond.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                spNumCondMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                spNumCondMouseExited(evt);
            }
        });

        jLabel1.setText("Número de condições:");

        jTempo01.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1)));

        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setText("Valor do Tempo");

        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel4.setText("Preço");

        jTM01.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTM01ActionPerformed(evt);
            }
        });

        jLabel5.setText("Tempo Mínimo?");

        jPreco01.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        jTempo02.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1)));

        jPreco02.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));

        jTM02.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTM02ActionPerformed(evt);
            }
        });

        jTempo03.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1)));

        jPreco03.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));

        jTM03.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTM03ActionPerformed(evt);
            }
        });

        jTempo04.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1)));

        jPreco04.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));

        jTM04.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTM04ActionPerformed(evt);
            }
        });

        jPreco08.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));

        jTM08.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTM08ActionPerformed(evt);
            }
        });

        jTempo05.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1)));

        jTM05.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTM05ActionPerformed(evt);
            }
        });

        jPreco05.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));

        jTempo06.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1)));

        jPreco06.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));

        jTM06.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTM06ActionPerformed(evt);
            }
        });

        jTempo07.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1)));

        jPreco07.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));

        jTM07.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTM07ActionPerformed(evt);
            }
        });

        jTempo08.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1)));

        jLabel6.setText("Minutos");

        jLabel7.setText("Minutos");

        jLabel8.setText("Minutos");

        jLabel9.setText("Minutos");

        jLabel10.setText("Minutos");

        jLabel11.setText("Minutos");

        jLabel12.setText("Minutos");

        jLabel13.setText("Minutos");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator1)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(spNumCond, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(textoTituloJanela)
                                .addGap(18, 18, 18)
                                .addComponent(jButton1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButton2))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jTempo08, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel13))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jTempo07, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel12))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jTempo06, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel11))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jTempo05, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel10))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jTempo04, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel9))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jTempo03, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel8)))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jPreco03, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jPreco04, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jPreco05, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jPreco06, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jPreco07, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jPreco08, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jTempo02, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel7)
                                .addGap(18, 18, 18)
                                .addComponent(jPreco02, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                        .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                        .addComponent(jTempo01, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel6)
                                        .addGap(18, 18, 18)
                                        .addComponent(jPreco01, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel5))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(33, 33, 33)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jTM02)
                                            .addComponent(jTM01)
                                            .addComponent(jTM07)
                                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                .addComponent(jTM03, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(jTM04)
                                                .addComponent(jTM05)
                                                .addComponent(jTM06))
                                            .addComponent(jTM08))))))))
                .addGap(0, 10, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1)
                    .addComponent(jButton2)
                    .addComponent(textoTituloJanela, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(spNumCond, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(25, 25, 25)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel4)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTM01, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTempo01, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPreco01, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel6)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTempo02, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPreco02, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel7))
                    .addComponent(jTM02))
                .addGap(6, 6, 6)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTM03, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTempo03, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPreco03, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel8)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTempo04, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPreco04, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel9))
                    .addComponent(jTM04))
                .addGap(5, 5, 5)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTempo05, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPreco05, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel10))
                    .addComponent(jTM05))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTempo06, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPreco06, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel11))
                    .addComponent(jTM06))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTempo07, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPreco07, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel12))
                    .addComponent(jTM07))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTempo08, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPreco08, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel13))
                    .addComponent(jTM08))
                .addContainerGap())
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-319)/2, (screenSize.height-383)/2, 319, 383);
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        dispose();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void spNumCondMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_spNumCondMouseEntered
        numeroCondicoes(Integer.parseInt(spNumCond.getValue().toString()));
    }//GEN-LAST:event_spNumCondMouseEntered

    private void spNumCondMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_spNumCondMouseExited
        numeroCondicoes(Integer.parseInt(spNumCond.getValue().toString()));
    }//GEN-LAST:event_spNumCondMouseExited

    private void jTM02ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTM02ActionPerformed
        if (jTM02.isSelected()) {
            jTM01.setSelected(false);
            jTM03.setSelected(false);
            jTM04.setSelected(false);
            jTM05.setSelected(false);
            jTM06.setSelected(false);
            jTM07.setSelected(false);
            jTM08.setSelected(false);
        }
    }//GEN-LAST:event_jTM02ActionPerformed

    private void jTM01ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTM01ActionPerformed
        if (jTM01.isSelected()) {
            jTM02.setSelected(false);
            jTM03.setSelected(false);
            jTM04.setSelected(false);
            jTM05.setSelected(false);
            jTM06.setSelected(false);
            jTM07.setSelected(false);
            jTM08.setSelected(false);
        }
    }//GEN-LAST:event_jTM01ActionPerformed

    private void jTM03ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTM03ActionPerformed
        if (jTM03.isSelected()) {
            jTM02.setSelected(false);
            jTM01.setSelected(false);
            jTM04.setSelected(false);
            jTM05.setSelected(false);
            jTM06.setSelected(false);
            jTM07.setSelected(false);
            jTM08.setSelected(false);
        }
    }//GEN-LAST:event_jTM03ActionPerformed

    private void jTM04ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTM04ActionPerformed
        if (jTM04.isSelected()) {
            jTM02.setSelected(false);
            jTM03.setSelected(false);
            jTM01.setSelected(false);
            jTM05.setSelected(false);
            jTM06.setSelected(false);
            jTM07.setSelected(false);
            jTM08.setSelected(false);
        }
    }//GEN-LAST:event_jTM04ActionPerformed

    private void jTM05ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTM05ActionPerformed
        if (jTM05.isSelected()) {
            jTM02.setSelected(false);
            jTM03.setSelected(false);
            jTM04.setSelected(false);
            jTM01.setSelected(false);
            jTM06.setSelected(false);
            jTM07.setSelected(false);
            jTM08.setSelected(false);
        }
    }//GEN-LAST:event_jTM05ActionPerformed

    private void jTM06ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTM06ActionPerformed
        if (jTM06.isSelected()) {
            jTM02.setSelected(false);
            jTM03.setSelected(false);
            jTM04.setSelected(false);
            jTM05.setSelected(false);
            jTM01.setSelected(false);
            jTM07.setSelected(false);
            jTM08.setSelected(false);
        }
    }//GEN-LAST:event_jTM06ActionPerformed

    private void jTM07ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTM07ActionPerformed
        if (jTM07.isSelected()) {
            jTM02.setSelected(false);
            jTM03.setSelected(false);
            jTM04.setSelected(false);
            jTM05.setSelected(false);
            jTM06.setSelected(false);
            jTM01.setSelected(false);
            jTM08.setSelected(false);
        }
    }//GEN-LAST:event_jTM07ActionPerformed

    private void jTM08ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTM08ActionPerformed
        if (jTM08.isSelected()) {
            jTM02.setSelected(false);
            jTM03.setSelected(false);
            jTM04.setSelected(false);
            jTM05.setSelected(false);
            jTM06.setSelected(false);
            jTM07.setSelected(false);
            jTM01.setSelected(false);
        }
    }//GEN-LAST:event_jTM08ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        ArrayList<FracaoTempo> fr = new ArrayList<FracaoTempo>();
        switch (Integer.parseInt(spNumCond.getValue().toString())) {
            case 1:
                FracaoTempo f11 = new FracaoTempo(Integer.parseInt(jTempo01.getValue().toString()), Float.parseFloat(jPreco01.getText()), jTM01.isSelected());
                fr.add(f11);
                break;
            case 2:
                FracaoTempo f21 = new FracaoTempo(Integer.parseInt(jTempo01.getValue().toString()), Float.parseFloat(jPreco01.getText()), jTM01.isSelected());
                fr.add(f21);
                FracaoTempo f22 = new FracaoTempo(Integer.parseInt(jTempo02.getValue().toString()), Float.parseFloat(jPreco02.getText()), jTM02.isSelected());
                fr.add(f22);
                break;
            case 3:
                FracaoTempo f31 = new FracaoTempo(Integer.parseInt(jTempo01.getValue().toString()), Float.parseFloat(jPreco01.getText()), jTM01.isSelected());
                fr.add(f31);
                FracaoTempo f32 = new FracaoTempo(Integer.parseInt(jTempo02.getValue().toString()), Float.parseFloat(jPreco02.getText()), jTM02.isSelected());
                fr.add(f32);
                FracaoTempo f33 = new FracaoTempo(Integer.parseInt(jTempo03.getValue().toString()), Float.parseFloat(jPreco03.getText()), jTM03.isSelected());
                fr.add(f33);
                break;
            case 4:
                FracaoTempo f41 = new FracaoTempo(Integer.parseInt(jTempo01.getValue().toString()), Float.parseFloat(jPreco01.getText()), jTM01.isSelected());
                fr.add(f41);
                FracaoTempo f42 = new FracaoTempo(Integer.parseInt(jTempo02.getValue().toString()), Float.parseFloat(jPreco02.getText()), jTM02.isSelected());
                fr.add(f42);
                FracaoTempo f43 = new FracaoTempo(Integer.parseInt(jTempo03.getValue().toString()), Float.parseFloat(jPreco03.getText()), jTM03.isSelected());
                fr.add(f43);
                FracaoTempo f44 = new FracaoTempo(Integer.parseInt(jTempo04.getValue().toString()), Float.parseFloat(jPreco04.getText()), jTM04.isSelected());
                fr.add(f44);
                break;
            case 5:
                FracaoTempo f51 = new FracaoTempo(Integer.parseInt(jTempo01.getValue().toString()), Float.parseFloat(jPreco01.getText()), jTM01.isSelected());
                fr.add(f51);
                FracaoTempo f52 = new FracaoTempo(Integer.parseInt(jTempo02.getValue().toString()), Float.parseFloat(jPreco02.getText()), jTM02.isSelected());
                fr.add(f52);
                FracaoTempo f53 = new FracaoTempo(Integer.parseInt(jTempo03.getValue().toString()), Float.parseFloat(jPreco03.getText()), jTM03.isSelected());
                fr.add(f53);
                FracaoTempo f54 = new FracaoTempo(Integer.parseInt(jTempo04.getValue().toString()), Float.parseFloat(jPreco04.getText()), jTM04.isSelected());
                fr.add(f54);
                FracaoTempo f55 = new FracaoTempo(Integer.parseInt(jTempo05.getValue().toString()), Float.parseFloat(jPreco05.getText()), jTM05.isSelected());
                fr.add(f55);
                break;
            case 6:
                FracaoTempo f61 = new FracaoTempo(Integer.parseInt(jTempo01.getValue().toString()), Float.parseFloat(jPreco01.getText()), jTM01.isSelected());
                fr.add(f61);
                FracaoTempo f62 = new FracaoTempo(Integer.parseInt(jTempo02.getValue().toString()), Float.parseFloat(jPreco02.getText()), jTM02.isSelected());
                fr.add(f62);
                FracaoTempo f63 = new FracaoTempo(Integer.parseInt(jTempo03.getValue().toString()), Float.parseFloat(jPreco03.getText()), jTM03.isSelected());
                fr.add(f63);
                FracaoTempo f64 = new FracaoTempo(Integer.parseInt(jTempo04.getValue().toString()), Float.parseFloat(jPreco04.getText()), jTM04.isSelected());
                fr.add(f64);
                FracaoTempo f65 = new FracaoTempo(Integer.parseInt(jTempo05.getValue().toString()), Float.parseFloat(jPreco05.getText()), jTM05.isSelected());
                fr.add(f65);
                FracaoTempo f66 = new FracaoTempo(Integer.parseInt(jTempo06.getValue().toString()), Float.parseFloat(jPreco06.getText()), jTM06.isSelected());
                fr.add(f66);
                break;
            case 7:
                FracaoTempo f71 = new FracaoTempo(Integer.parseInt(jTempo01.getValue().toString()), Float.parseFloat(jPreco01.getText()), jTM01.isSelected());
                fr.add(f71);
                FracaoTempo f72 = new FracaoTempo(Integer.parseInt(jTempo02.getValue().toString()), Float.parseFloat(jPreco02.getText()), jTM02.isSelected());
                fr.add(f72);
                FracaoTempo f73 = new FracaoTempo(Integer.parseInt(jTempo03.getValue().toString()), Float.parseFloat(jPreco03.getText()), jTM03.isSelected());
                fr.add(f73);
                FracaoTempo f74 = new FracaoTempo(Integer.parseInt(jTempo04.getValue().toString()), Float.parseFloat(jPreco04.getText()), jTM04.isSelected());
                fr.add(f74);
                FracaoTempo f75 = new FracaoTempo(Integer.parseInt(jTempo05.getValue().toString()), Float.parseFloat(jPreco05.getText()), jTM05.isSelected());
                fr.add(f75);
                FracaoTempo f76 = new FracaoTempo(Integer.parseInt(jTempo06.getValue().toString()), Float.parseFloat(jPreco06.getText()), jTM06.isSelected());
                fr.add(f76);
                FracaoTempo f77 = new FracaoTempo(Integer.parseInt(jTempo07.getValue().toString()), Float.parseFloat(jPreco07.getText()), jTM07.isSelected());
                fr.add(f77);
                break;
            case 8:
                FracaoTempo f81 = new FracaoTempo(Integer.parseInt(jTempo01.getValue().toString()), Float.parseFloat(jPreco01.getText()), jTM01.isSelected());
                fr.add(f81);
                FracaoTempo f82 = new FracaoTempo(Integer.parseInt(jTempo02.getValue().toString()), Float.parseFloat(jPreco02.getText()), jTM02.isSelected());
                fr.add(f82);
                FracaoTempo f83 = new FracaoTempo(Integer.parseInt(jTempo03.getValue().toString()), Float.parseFloat(jPreco03.getText()), jTM03.isSelected());
                fr.add(f83);
                FracaoTempo f84 = new FracaoTempo(Integer.parseInt(jTempo04.getValue().toString()), Float.parseFloat(jPreco04.getText()), jTM04.isSelected());
                fr.add(f84);
                FracaoTempo f85 = new FracaoTempo(Integer.parseInt(jTempo05.getValue().toString()), Float.parseFloat(jPreco05.getText()), jTM05.isSelected());
                fr.add(f85);
                FracaoTempo f86 = new FracaoTempo(Integer.parseInt(jTempo06.getValue().toString()), Float.parseFloat(jPreco06.getText()), jTM06.isSelected());
                fr.add(f86);
                FracaoTempo f87 = new FracaoTempo(Integer.parseInt(jTempo07.getValue().toString()), Float.parseFloat(jPreco07.getText()), jTM07.isSelected());
                fr.add(f87);
                FracaoTempo f88 = new FracaoTempo(Integer.parseInt(jTempo08.getValue().toString()), Float.parseFloat(jPreco08.getText()), jTM08.isSelected());
                fr.add(f88);
                break;
        }
        
        System.out.println(fr);
    }//GEN-LAST:event_jButton2ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JFormattedTextField jPreco01;
    private javax.swing.JFormattedTextField jPreco02;
    private javax.swing.JFormattedTextField jPreco03;
    private javax.swing.JFormattedTextField jPreco04;
    private javax.swing.JFormattedTextField jPreco05;
    private javax.swing.JFormattedTextField jPreco06;
    private javax.swing.JFormattedTextField jPreco07;
    private javax.swing.JFormattedTextField jPreco08;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JCheckBox jTM01;
    private javax.swing.JCheckBox jTM02;
    private javax.swing.JCheckBox jTM03;
    private javax.swing.JCheckBox jTM04;
    private javax.swing.JCheckBox jTM05;
    private javax.swing.JCheckBox jTM06;
    private javax.swing.JCheckBox jTM07;
    private javax.swing.JCheckBox jTM08;
    private javax.swing.JSpinner jTempo01;
    private javax.swing.JSpinner jTempo02;
    private javax.swing.JSpinner jTempo03;
    private javax.swing.JSpinner jTempo04;
    private javax.swing.JSpinner jTempo05;
    private javax.swing.JSpinner jTempo06;
    private javax.swing.JSpinner jTempo07;
    private javax.swing.JSpinner jTempo08;
    private javax.swing.JSpinner spNumCond;
    private javax.swing.JLabel textoTituloJanela;
    // End of variables declaration//GEN-END:variables
}
